import request from '@/config/axios'

// 展项管理 VO
export interface ExhibitVO {
  id: number // 主键
  exhibitName: string // 展品名称
  isMedia: boolean // 多媒体
  videoPath: string // 视频文件位置
  videoIp: string // 视频主机ip
  airSn: string // 空开编号
  floorId: number // 楼层ID
  areaId: number // 展区ID
  airStatus: number // 通电状态
  x: string // x坐标
  y: string // y坐标
  imageIcon: string // 图标
  orderNum: number // 排序
}

// 展项管理 API
export const ExhibitApi = {
  // 查询展项管理分页
  getExhibitPage: async (params: any) => {
    return await request.get({ url: `/zkteco/exhibit/page`, params })
  },

  // 查询展项管理详情
  getExhibit: async (id: number) => {
    return await request.get({ url: `/zkteco/exhibit/get?id=` + id })
  },

  // 新增展项管理
  createExhibit: async (data: ExhibitVO) => {
    return await request.post({ url: `/zkteco/exhibit/create`, data })
  },

  // 修改展项管理
  updateExhibit: async (data: ExhibitVO) => {
    return await request.put({ url: `/zkteco/exhibit/update`, data })
  },

  // 删除展项管理
  deleteExhibit: async (id: number) => {
    return await request.delete({ url: `/zkteco/exhibit/delete?id=` + id })
  },

  // 导出展项管理 Excel
  exportExhibit: async (params) => {
    return await request.download({ url: `/zkteco/exhibit/export-excel`, params })
  },

// ==================== 子表（设备信息） ====================

  // 获得设备信息分页
  getEquipmentPage: async (params) => {
    return await request.get({ url: `/zkteco/exhibit/equipment/page`, params })
  },
  // 新增设备信息
  createEquipment: async (data) => {
    return await request.post({ url: `/zkteco/exhibit/equipment/create`, data })
  },

  // 修改设备信息
  updateEquipment: async (data) => {
    return await request.put({ url: `/zkteco/exhibit/equipment/update`, data })
  },

  // 删除设备信息
  deleteEquipment: async (id: number) => {
    return await request.delete({ url: `/zkteco/exhibit/equipment/delete?id=` + id })
  },

  // 获得设备信息
  getEquipment: async (id: number) => {
    return await request.get({ url: `/zkteco/exhibit/equipment/get?id=` + id })
  },
}